//
//  SampuxCustomSlider.m
//  Sampux
//
//  Created by rzm on 16/9/8.
//  Copyright © 2016年 rzm. All rights reserved.
//

#import "SampuxCustomSlider.h"

@implementation SampuxCustomSlider

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
    }
    return self;
}



- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    CGRect t = [self trackRectForBounds: [self bounds]];
    float v = [self minimumValue] + ([[touches anyObject] locationInView: self].x - t.origin.x - 4.0) * (([self maximumValue]-[self minimumValue]) / (t.size.width - 8.0));
    [self setValue: v + 5];
    [super touchesBegan: touches withEvent: event];

}
@end
